package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.user.db.dao.UserAccessRongcloudDao;
import com.kly.user.db.entity.UserAccessRongcloudEntity;
import com.kly.user.utils.ServiceUtils;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: 11437
* Date: 2023-05-24
* Time: 14:56:13.751
*/

@Repository
public class UserAccessRongcloudDaoImpl extends AbstractBaseMapper<UserAccessRongcloudEntity> implements UserAccessRongcloudDao {

    @Override
    public String getRongCloudToken(String userCode) {
        final HashMap<String, Object> params = Maps.newHashMap();
        params.put("userCode", userCode);
        return this.getSqlSession().selectOne(this.getStatement("getRongCloudToken"), params);
    }

    @Override
    public List<UserAccessRongcloudEntity> getRongCloudTokens(List<String> userCodes) {
        HashMap<String, Object> params = Maps.newHashMap();
        params.put("userCodes", userCodes);
        return this.getSqlSession().selectList(this.getStatement("getRongCloudTokens"), params);
    }
}